package com.shine.icis.hbean;

import java.io.Serializable;
import java.text.DecimalFormat;
import java.util.Set;

import com.shine.icis.util.Tools;

public class DataCheckR12 implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3662405149335236166L;
	
	//private DecimalFormat doubleFormat = new DecimalFormat("0.00");"
	private DecimalFormat doubleFormat = new DecimalFormat("##,##0.00");
	private Integer id;
	private double accSumAmt;//客户资金账户汇总余额
	private double bankAmt;//客户资金专用银行存款
	private double reservesAmt;//客户结算备付金
	private double bailA13Amt;//客户交易保证金(A13)
	private double bailSdcAmt;//客户交易保证金(中登)
	private double arapAmt;//应收应付金额
	private double settleAmt;//应交收金额(不含三板数据）
	private double fullComm;//证券公司向客户扣收的手续费
	private double bankInterest;//证券公司客户资金存款账户收到的利息
	private double sdcCommAmt;//证券公司支付登记公司的一级费用(不含三板数据）
	private double secInterest;//证券公司向客户支付的结息金额
	private double bankComm;//银行收取的手续费
	private double sqtClearAmt;//清算金额（三板）
	private double sqtStamptax;//印花税（三板）
	private double discAmt;//挪用金额
	private String note;//备注
	private int busiDate;//数据日期
	private int operDate;//操作日期
	private int operTime;//操作时间

	private DataCheckR12 relateObj;//关联ID
	private Set<DataCheckR12> relateObjs;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public double getAccSumAmt() {
		return accSumAmt;
	}
	public String getAccSumAmtText() {
		return doubleFormat.format(accSumAmt);
	}
	public String getAccSumAmtNote() {
		if (this.getModifyObj() == null) {
			return getAccSumAmtText();
		}
		return getAccSumAmtText() + " → " + this.getModifyObj().getAccSumAmtText();
	}
	public void setAccSumAmt(double accSumAmt) {
		this.accSumAmt = accSumAmt;
	}
	public double getBankAmt() {
		return bankAmt;
	}
	public String getBankAmtText() {
		return doubleFormat.format(bankAmt);
	}
	public String getBankAmtNote() {
		if (this.getModifyObj() == null) {
			return getBankAmtText();
		}
		return getBankAmtText() + " → " + this.getModifyObj().getBankAmtText();
	}
	public void setBankAmt(double bankAmt) {
		this.bankAmt = bankAmt;
	}
	public double getReservesAmt() {
		return reservesAmt;
	}
	public String getReservesAmtText() {
		return doubleFormat.format(reservesAmt);
	}
	public String getReservesAmtNote() {
		if (this.getModifyObj() == null) {
			return getReservesAmtText();
		}
		return getReservesAmtText() + " → " + this.getModifyObj().getReservesAmtText();
	}
	public void setReservesAmt(double reservesAmt) {
		this.reservesAmt = reservesAmt;
	}
	public double getBailA13Amt() {
		return bailA13Amt;
	}
	public String getBailA13AmtText() {
		return doubleFormat.format(bailA13Amt);
	}
	public String getBailA13AmtNote() {
		if (this.getModifyObj() == null) {
			return getBailA13AmtText();
		}
		return getBailA13AmtText() + " → " + this.getModifyObj().getBailA13AmtText();
	}
	public void setBailA13Amt(double bailA13Amt) {
		this.bailA13Amt = bailA13Amt;
	}
	public double getBailSdcAmt() {
		return bailSdcAmt;
	}
	public String getBailSdcAmtText() {
		return doubleFormat.format(bailSdcAmt);
	}
	public String getBailSdcAmtNote() {
		if (this.getModifyObj() == null) {
			return getBailSdcAmtText();
		}
		return getBailSdcAmtText() + " → " + this.getModifyObj().getBailSdcAmtText();
	}
	public void setBailSdcAmt(double bailSdcAmt) {
		this.bailSdcAmt = bailSdcAmt;
	}
	public double getArapAmt() {
		return arapAmt;
	}
	public String getArapAmtText() {
		return doubleFormat.format(arapAmt);
	}
	public String getArapAmtNote() {
		if (this.getModifyObj() == null) {
			return getArapAmtText();
		}
		return getArapAmtText() + " → " + this.getModifyObj().getArapAmtText();
	}
	public void setArapAmt(double arapAmt) {
		this.arapAmt = arapAmt;
	}
	public double getSettleAmt() {
		return settleAmt;
	}
	public String getSettleAmtText() {
		return doubleFormat.format(settleAmt);
	}
	public String getSettleAmtNote() {
		if (this.getModifyObj() == null) {
			return getSettleAmtText();
		}
		return getSettleAmtText() + " → " + this.getModifyObj().getSettleAmtText();
	}
	public void setSettleAmt(double settleAmt) {
		this.settleAmt = settleAmt;
	}
	public double getFullComm() {
		return fullComm;
	}
	public String getFullCommText() {
		return doubleFormat.format(fullComm);
	}
	public String getFullCommNote() {
		if (this.getModifyObj() == null) {
			return getFullCommText();
		}
		return getFullCommText() + " → " + this.getModifyObj().getFullCommText();
	}
	public void setFullComm(double fullComm) {
		this.fullComm = fullComm;
	}
	public double getBankInterest() {
		return bankInterest;
	}
	public String getBankInterestText() {
		return doubleFormat.format(bankInterest);
	}
	public String getBankInterestNote() {
		if (this.getModifyObj() == null) {
			return getBankInterestText();
		}
		return getBankInterestText() + " → " + this.getModifyObj().getBankInterestText();
	}
	public void setBankInterest(double bankInterest) {
		this.bankInterest = bankInterest;
	}
	public double getSdcCommAmt() {
		return sdcCommAmt;
	}
	public String getSdcCommAmtText() {
		return doubleFormat.format(sdcCommAmt);
	}
	public String getSdcCommAmtNote() {
		if (this.getModifyObj() == null) {
			return getSdcCommAmtText();
		}
		return getSdcCommAmtText() + " → " + this.getModifyObj().getSdcCommAmtText();
	}
	public void setSdcCommAmt(double sdcCommAmt) {
		this.sdcCommAmt = sdcCommAmt;
	}
	public double getSecInterest() {
		return secInterest;
	}
	public String getSecInterestText() {
		return doubleFormat.format(secInterest);
	}
	public String getSecInterestNote() {
		if (this.getModifyObj() == null) {
			return getSecInterestText();
		}
		return getSecInterestText() + " → " + this.getModifyObj().getSecInterestText();
	}
	public void setSecInterest(double secInterest) {
		this.secInterest = secInterest;
	}
	public double getBankComm() {
		return bankComm;
	}
	public String getBankCommText() {
		return doubleFormat.format(bankComm);
	}
	public String getBankCommNote() {
		if (this.getModifyObj() == null) {
			return getBankCommText();
		}
		return getBankCommText() + " → " + this.getModifyObj().getBankCommText();
	}
	public void setBankComm(double bankComm) {
		this.bankComm = bankComm;
	}
	public double getSqtClearAmt() {
		return sqtClearAmt;
	}
	public String getSqtClearAmtText() {
		return doubleFormat.format(sqtClearAmt);
	}
	public String getSqtClearAmtNote() {
		if (this.getModifyObj() == null) {
			return getSqtClearAmtText();
		}
		return getSqtClearAmtText() + " → " + this.getModifyObj().getSqtClearAmtText();
	}
	public void setSqtClearAmt(double sqtClearAmt) {
		this.sqtClearAmt = sqtClearAmt;
	}
	public double getSqtStamptax() {
		return sqtStamptax;
	}
	public String getSqtStamptaxText() {
		return doubleFormat.format(sqtStamptax);
	}
	public String getSqtStamptaxNote() {
		if (this.getModifyObj() == null) {
			return getSqtStamptaxText();
		}
		return getSqtStamptaxText() + " → " + this.getModifyObj().getSqtStamptaxText();
	}
	public void setSqtStamptax(double sqtStamptax) {
		this.sqtStamptax = sqtStamptax;
	}
	public double getDiscAmt() {
		return discAmt;
	}
	public String getDiscAmtText() {
		return doubleFormat.format(discAmt);
	}
	public String getDiscAmtNote() {
		if (this.getModifyObj() == null) {
			return getDiscAmtText();
		}
		return getDiscAmtText() + " → " + this.getModifyObj().getDiscAmtText();
	}
	public void setDiscAmt(double discAmt) {
		this.discAmt = discAmt;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}

	public int getBusiDate() {
		return busiDate;
	}
	public void setBusiDate(int busiDate) {
		this.busiDate = busiDate;
	}
	public int getOperDate() {
		return operDate;
	}
	public void setOperDate(int operDate) {
		this.operDate = operDate;
	}
	public int getOperTime() {
		return operTime;
	}
	public void setOperTime(int operTime) {
		this.operTime = operTime;
	}
	
	public DataCheckR12 getRelateObj() {
		return relateObj;
	}
	public void setRelateObj(DataCheckR12 relateObj) {
		this.relateObj = relateObj;
	}
	
	public Set<DataCheckR12> getRelateObjs() {
		return relateObjs;
	}
	public void setRelateObjs(Set<DataCheckR12> relateObjs) {
		this.relateObjs = relateObjs;
	}
	
	public String getFormatOperTime() {
		StringBuffer sb = new StringBuffer();
		sb.append(operDate);
		if (sb.length() != 8) {
			return "";
		}
		sb.insert(6, "-").insert(4, "-");
		//121200 -> 12:12:00
		StringBuffer sbt = new StringBuffer();
		sbt.append(Tools.getFixedNum(operTime, 6));
		sbt.insert(4, ":").insert(2, ":").toString();
		
		return sb.append(" ").append(sbt).toString();
	}
	
	public DataCheckR12 getModifyObj() {
		if (relateObjs == null || relateObjs.isEmpty()) {
			return null;
		}
		return relateObjs.iterator().next();
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final DataCheckR12 other = (DataCheckR12) obj;
		if (id == null) {
//			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	
	
	
}
